package com.ars.website;

import com.ars.db.DBTools;
import javafx.fxml.FXML;
import javafx.scene.control.TextField;

import javax.swing.*;

public class DeleteWebsiteController {
    @FXML
    private TextField tfWebsiteName;

    @FXML
    public void okButtonAction() {
        String websiteName = tfWebsiteName.getText().trim();
        DBTools p = new DBTools();
        if(websiteName.isEmpty()){
            JOptionPane.showMessageDialog(null,"请填写要删除的网点名");
        }else{
            String sql = "delete from website where name='" + websiteName + "'";
            p.update(sql);
        }
    }

    @FXML
    public void cancelButtonAction() {
        tfWebsiteName.clear();
    }
}
